<template>
  <div class="property-color-item-div">
    <div style="display:flex;align-items:center;">
      <div class="property-color-item-block" :style="style">-</div>
      <div>{{ value.label }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ColorItem',
  props: {
    value: {
      type: Object,
      default: () => {
        return {}
      },
      key: {
        type: String,
        require: false,
        default: 'ByLayer'
      },
      color: {
        type: String,
        require: true,
        default: '#FFFFFF'
      },
      label: {
        type: String,
        required: true,
        default: '白'
      }
    },
    width: {
      type: Number,
      required: false,
      default: 120
    },
    height: {
      type: Number,
      required: false,
      default: 12
    }
  },
  computed: {
    style() {
      return {
        backgroundColor: this.value.color,
        color: this.value.color
      }
    }
  }
}
</script>

<style lang="scss">
.property-color-item-div {
  .property-color-item-block {
    padding: 0px;
    background-color: #ffffff;
    color: #ffffff;
    height: 12px;
    line-height: 12px;
    max-height: 12px;
    border: 1px solid#3b3c40;
    width: 50%;
    margin-right: 6px;
  }
}
</style>
